import { Space } from 'antd'
import React from 'react'

export function getColumns (common, structureMap, setVisible, setModifyData, refreshFn) {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: 'center',
      width: '60px'
    },
    {
      title: '姓名',
      dataIndex: 'name',
      key: 'name',
      width: 100
    },
    {
      title: '性别',
      dataIndex: 'gender',
      key: 'gender',
      width: 100
    },
    {
      title: '国家地区',
      dataIndex: 'country',
      key: 'country',
      width: 100
    },
    {
      title: '所在单位',
      dataIndex: 'structure',
      key: 'structure',
      width: 100
    },
    {
      title: '单位职务',
      dataIndex: 'structure_post',
      key: 'structure_post',
      width: 100
    },
    {
      title: '职业分类',
      dataIndex: 'occupation',
      key: 'occupation',
      width: 100
    },
    {
      title: '是否擅长涉外案件',
      dataIndex: 'foreign_case_in',
      key: 'foreign_case_in',
      width: 100,
      render: (v) => {
        if (v === '1') {
          return '是'
        } else if (v === '0') {
          return '否'
        }
      }
    },
    {
      title: '操作',
      dataIndex: 'index',
      key: 'operate',
      width: 60,
      render: (value, line) => {
        return (
          <Space size='middle'>
            <a onClick={() => { setModifyData(line); setVisible(true) }}>详情</a>
          </Space>
        )
      }
    }
  ]
}
